LN	=	ln -fFs
SRCS	=	dot.emacs	\
		dot.emacs.files	\
		dot.zshrc	\
		dot.zshrc.local	\
		dot.vim		\
		dot.vimrc	\
		dot.go		\
		dot.tmux.conf	\
		dot.hgrc
OBJS	=	$(subst dot, ${HOME}/, $(SRCS))

all	: preinstall $(OBJS)

$(OBJS) :
	 $(LN) $(subst ${HOME}/, ${PWD}/dot, $@) $@

preinstall:
	$(LN) ${GOROOT}/misc/vim/ftdetect/gofiletype.vim dot.vim/ftdetect/gofiletype.vim
	$(LN) ${GOROOT}/misc/vim/syntax/go.vim dot.vim/syntax/go.vim
	$(LN) ${GOROOT}/misc/emacs/go-mode.el dot.emacs.files/go-mode.el
	$(LN) ${GOROOT}/misc/emacs/go-mode-load.el dot.emacs.files/go-mode-load.el

clean	:
	$(RM) dot.vim/syntax/go.vim dot.vim/ftdetect/gofiletype.vim
	$(RM) dot.emacs.files/go-mode.el dot.emacs.files/go-mode-load.el
	$(RM) $(OBJS)

re	:	clean all

